//
// Created by Toosan on 2022/4/23.
//

#ifndef CPLUS_LEARN_PROJECT_MAIN3_H // 判断有没有宏(Java中的常量)
#define CPLUS_LEARN_PROJECT_MAIN3_H // 没有的话镜定义这个宏

#include "iostream"
#include "string.h"

using namespace std;

class Pig {
private:
    int age;
    char *name;
public:
    static int id;

    Pig();

    Pig(int);

    Pig(char *);

    // age,name不暴露给外面，在实现里面写明
    Pig(int, char *);

    ~Pig();

    Pig(const Pig &pig);

    int getAge() const;

    void setAge(int age);

    char * getName() const;

    void setName(char *);

    void showPigInfo() const;

    static void changeId(int id);

    friend void changeAge(Pig *pig, int age);

};

#endif //CPLUS_LEARN_PROJECT_MAIN3_H
